<template>
  <div class="wantBuyDetail-list">
    <view class="total-view"
      >{{$t('locales.share')}}<text style="color: #e5905b">{{ valueData.length || 0 }}</text
      >{{$t('locales.totalPurchase')}}</view
    >

    <view
      class="Detail-list__item"
      v-for="(goods, index) in valueData"
      :key="index"
    >
      <view class="Detail-list__item-top">
        <view class="Detail-list__item-store">
          <text>{{ goods.enterpriseName }}</text>
          <text class="new" v-if="goods.newFlag === 1">New</text>
        </view>

        <view class="Detail-list__item-contact">
          <view class="item">{{$t('locales.contacts')}}：{{ goods.enterpriseContacts }}</view>
          <view class="item">{{$t('locales.contactNumber')}}：{{ goods.enterprisePhone }}</view>
        </view>
      </view>

      <view class="Detail-list__item-bottom">
        <view
          class="item-bottom__goods"
          v-for="item in goods.purchaseViewQuoteEnterpriseGoodsVO"
          :key="item.goodsId"
          @click="navSwitch('/pages/productDetails/index?id=' + item.goodsId + '&purchaseId=' + purchase.id)"
        >
          <image class="goods-img" :src="item.goodsPicUrl" />
          <view class="goods-info">
            <view class="goods-name u-line-2">{{ item.goodsName }}</view>
            <view class="goods-prc">
              <!-- <text class="iden">RMB￥</text> -->
              <text>{{ item.stringPrice }}</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </div>
</template>
<script>
export default {
  props: {
    valueData: {
      type: Array,
      default: () => []
    },
    purchase: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    navSwitch(url) {
      uni.navigateTo({
        url
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.wantBuyDetail-list {
  .total-view {
    line-height: 90rpx;
    padding: 0 36rpx;
    font-size: 28rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #545454;
  }

  .Detail-list__item {
    margin: 0 24rpx 17rpx 24rpx;
    background-color: #fff;
    border-radius: 16rpx;

    .Detail-list__item-top {
      border-bottom: 1px solid #e3e6ed;
      padding: 0 24rpx;
      padding-bottom: 24rpx;
      .Detail-list__item-store {
        font-size: 30rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #212121;
        line-height: 70rpx;
        .new {
          margin-left: 20rpx;
          font-size: 28rpx;
          font-family: PingFang SC;
          font-weight: 500;
          font-style: italic;
          color: #ff0f10;
        }
      }

      .Detail-list__item-contact {
        display: flex;
        font-size: 28rpx;
        font-family: PingFang SC;
        font-weight: 500;
        color: #545454;
        .item {
          flex: 1;
        }
      }
    }

    .Detail-list__item-bottom {
      padding: 0 24rpx;
      .item-bottom__goods {
        padding: 24rpx 0;
        display: flex;
        border-bottom: 1px solid #e3e6ed;
        .goods-img {
          width: 164rpx;
          height: 164rpx;
          border-radius: 8rpx;
          margin-right: 24rpx;
          // background-color: #999;
        }

        .goods-info {
          flex: 1;
          font-size: 26rpx;
          font-family: PingFang SC;
          font-weight: 500;
          color: #333333;
          display: flex;
          flex-direction: column;
          justify-content: space-between;

          .goods-prc {
            font-size: 36rpx;
            font-family: PingFang SC;
            font-weight: 500;
            color: #ff0f10;
            .iden {
              font-size: 22rpx;
            }
          }
        }
      }

      .item-bottom__goods:last-child {
        border: none;
      }
    }
  }
}
</style>